package com.itheima.extendedHomework.test1;
/*
1.百钱百鸡
	已知：公鸡5块钱一只，母鸡3块钱一只，小鸡1块钱三只，现在我手上有100块钱
	问：我要买一百只鸡。公鸡，母鸡，小鸡我需要各买几只
 */
public class HundredDollarsAndHundredChickens {
    public static void main(String[] args) {
        int allMoney = 100;
        int payForCock = 5;
        int payForHen = 3;
        int payForChick = 1;

        for (int i = 0; i < 100 / 5; i++) {
            for (int j = 0; j < 100 - 5 * i; j++) {
                int money = 100 - 5*i - 3*j;
                int num = i + j + money*3;
                if (num == 100){
                    System.out.println("购买公鸡：" + i + "只");
                    System.out.println("购买母鸡：" + j + "只");
                    System.out.println("购买小鸡：" + money*3 + "只");
                    System.out.println("-------------------------");
                }
            }
        }
    }
}
